<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

    <f:view contentType="text/html">
        <h:head>
            <f:facet name="first">
                <meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>
                <h:outputStylesheet library="css" name="estilo.css"/>
                <title>LlamadasEc</title>
            </f:facet>
        </h:head>

        <h:body>
            <h:form id="formLlamar">
                <center>
                    <br/>
                    <p:panel header="Hacer Llamada" style="width: 300px">
                        <br/>
                        <h:panelGrid columns="1">
                            <p:inputText id="numero" value="#{llamadasBacking.numero}" style="text-align: right"/> 
                            <p:commandLink value="Limpiar" style="font-size: 10px;" action="#{llamadasBacking.limpiar()}" update="numero"/>
                        </h:panelGrid> 
                        <h:panelGrid columns="3">
                            <p:commandButton value="1" action="#{llamadasBacking.marcar('1')}" update="numero"/>
                            <p:commandButton value="2" action="#{llamadasBacking.marcar('2')}" update="numero"/>
                            <p:commandButton value="3" action="#{llamadasBacking.marcar('3')}" update="numero"/>
                            <p:commandButton value="4" action="#{llamadasBacking.marcar('4')}" update="numero"/>
                            <p:commandButton value="5" action="#{llamadasBacking.marcar('5')}" update="numero"/>
                            <p:commandButton value="6" action="#{llamadasBacking.marcar('6')}" update="numero"/>
                            <p:commandButton value="7" action="#{llamadasBacking.marcar('7')}" update="numero"/>
                            <p:commandButton value="8" action="#{llamadasBacking.marcar('8')}" update="numero"/>
                            <p:commandButton value="9" action="#{llamadasBacking.marcar('9')}" update="numero"/>
                            &nbsp;
                            <p:commandButton value="0" action="#{llamadasBacking.marcar('0')}" update="numero"/>
                            &nbsp;
                        </h:panelGrid>
                        <br/>
                        <p:commandButton id="botonLlamar" action="#{llamadasBacking.llamar()}"  value="Llamar" oncomplete="PF('dlg').show()" icon="ui-icon-llamar"/>
                    </p:panel>
                    <p:dialog widgetVar="dlg" modal="true" showEffect="fade" hideEffect="fade" header="Llamando..." resizable="false" closable="false">
                        <br/>
                        <img src="resources/images/llamando.gif"/>
                        <br/>
                        <br/>
                        <p:commandButton id="botonColgar" action="#{llamadasBacking.colgar()}" value="Colgar" oncomplete="PF('dlg').hide()" icon="ui-icon-colgar"/> 
                    </p:dialog>
                </center>
            </h:form>
        </h:body>
    </f:view>
</html>

